Skip to content

fix(dav): Strip DTSTAMP before etag comparison in webcal refresh#58193

Open
Olen wants to merge 1 commit intonextcloud:masterfrom
Olen:fix/strip-dtstamp-webcal-refresh
Open

fix(dav): Strip DTSTAMP before etag comparison in webcal refresh#58193
Olen wants to merge 1 commit intonextcloud:masterfrom
Olen:fix/strip-dtstamp-webcal-refresh

Conversation

@Olen
Copy link

@Olen Olen commented Feb 9, 2026

Summary

  • Exclude DTSTAMP from etag computation in RefreshWebcalService to prevent false change detection
  • DTSTAMP is preserved in stored calendar data (required property per RFC 5545)

Problem

Many iCal providers (Google Calendar, Outlook 365, itslearning) set DTSTAMP to the current UTC time on every feed request per RFC 5545. Since Nextcloud computes the etag as md5(serialized_data) and DTSTAMP changes every time, every event appears modified on every refresh — even if nothing actually changed.

For a Google Calendar subscription with 2,621 events refreshed every ~15 minutes, this generates ~189K false change rows per day in oc_calendarchanges.

Reported at: #51120 (comment)

Approach

Instead of stripping DTSTAMP from the VObject (which would remove a required property from stored data), the fix strips DTSTAMP lines from a copy of the serialized string used only for etag computation:

$sObjectForEtag = preg_replace('/^DTSTAMP:.*\r?\n/m', '', $sObject);
$etag = md5($sObjectForEtag);

The stored calendar data ($sObject) is completely unchanged.

Test plan

  • New test testDtstampChangeDoesNotTriggerUpdate verifies a DTSTAMP-only change does not trigger updateCalendarObject
  • Updated identicalDataProvider etag computation to match the new DTSTAMP-stripped hashing
  • Run RefreshWebcalServiceTest unit tests

Fixes: #51120

🤖 Generated with Claude Code

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Optimize Deletion of Objects for Calendar Subscriptions

4 participants